{#{% extends 'Base/main.content.lists.div.html.twig' %}#}
{#{% import 'Base/list_item.twig' as listItem %}#}
{% extends 'Back/Sano/list.creator.html.twig' %}
{% import 'Back/Sano/list.item.twig' as listItem %}
{#默认不能删除和新增#}
 {% block addBtn %}
     {% if isMy == 0 %}
{#         <a class="btn btn-outline-primary" href="{{ urls.addUrl is defined ? urls.addUrl ~ "?isMy=0" : '' }}">#}
{#             <span class="fa fa-plus"></span> 新增#}
{#         </a>#}
     {% else %}
         <a class="btn btn-outline-primary" href="{{ urls.addUrl is defined ? urls.addUrl ~ "?isMy=1" : '' }}">
             <span class="fa fa-plus"></span> 新增
         </a>
     {% endif %}
{#     {% if isMy == 0 %}#}
{#     {% else %}#}
{#     {% endif %}#}
 {% endblock %}

{% block delBtn %}
    <div class="btn btn-outline-primary ml-2" id="ComListCheckAll">
        <span class="ion ion-android-checkbox-outline"></span>
        <span class="text">全选</span>
    </div>
    <div class="btn btn-outline-danger ml-2" id="ComListDelete">
        <span class="ion ion-trash-b"></span>
        <span class="text">删除</span>
    </div>
    <a href="javascript:excelOut();" class="btn btn-outline-danger ml-2" >
        <span class="text">导出</span>
        <input id="excel" type="hidden" name="cond[excel]" value="0">
        {% if isMy == 1 %}<input id="excel" type="hidden" name="cond[isMy]" value="1">{% endif %}
    </a>
{% endblock %}
{% block options %}
{% endblock %}
{% block toolsExt %}
    {% if isMy == 0 %}
        <div class="pad10">
            <div class="fs8 c12">精确筛查</div>
            <div class="row">
                    {% for key , classes in tools %}
                        {% set default = "请选择" %}
                        {% set classes = classes %}
{#                        <div class="">#}
                            <div class="rule-single-select layui-inline col-md-4">
                                <select name="cond[{{ key }}]" onchange="javascript:__doPostBack('searchCond','')" >
                                    <option value="" {{app.request.get("cond")[key] is defined and app.request.get("cond")[key] == "" ? ' selected="selected"' : "" }} >{{ default }}</option>
                                    {% for class in classes %}
                                        <option value="{{ class.id }}"
                                                {{app.request.get("cond")[key] is defined and  app.request.get("cond")[key] == class.id ? ' selected="selected"' : "" }}
                                        >{{ class.name }}</option>
                                    {% endfor %}
                                </select>
                            </div>
{#                        </div>#}
                    {% endfor %}
            </div>
            <div id="selector" >
                <div class="padt10 pab10 padl3 padr3">
                        <mu-row >
                            <mu-col class="" span="12" lg="2" sm="6">
                                <mu-date-input clock-type="24hr" name="cond[start]" v-model="start" :actions="true" placeholder="登记时间开始" type="dateTime" full-width landscape></mu-date-input>
                            </mu-col>
                            <mu-col class="" span="12" lg="2" sm="6">
                                <mu-date-input clock-type="24hr" name="cond[end]" v-model="end" :actions="true" placeholder="登记时间结束" type="dateTime" full-width landscape></mu-date-input>
                            </mu-col>
                            <mu-col class="" span="12" lg="1" sm="6">
                                <mu-button small @click="start='';end=''" full-width><span class="fs7">清空</span></mu-button>
                            </mu-col>
                            <mu-col class="" span="12" lg="2" sm="6" offset="2" >
                                <mu-date-input clock-type="24hr" name="cond[backStart]" v-model="backStart" :actions="true" placeholder="回来日期开始" type="date" full-width landscape></mu-date-input>
                            </mu-col>
                            <mu-col class="" span="12" lg="2" sm="6">
                                <mu-date-input clock-type="24hr" name="cond[backend]" v-model="backend" :actions="true" placeholder="回来日期结束" type="date" full-width landscape></mu-date-input>
                            </mu-col>
                            <mu-col class="" span="12" lg="1" sm="6">
                                <mu-button small @click="backStart='';backend=''" full-width><span class="fs7">清空</span></mu-button>
                            </mu-col>
                        </mu-row>
                </div>
                <div>
                    <mu-row >
                        <mu-col class="" span="12" lg="2" sm="6" offset="5" >
                            <mu-button color="primary" @click="query()" full-width><span class="fs9">查询</span></mu-button>
                        </mu-col>
                    </mu-row>
                </div>
            </div>
        </div>
    {% endif %}
{% endblock %}



{% block tableHead %}
    <tr>
        <th align="" width="5%">选择</th>
        <th align="" width="">{{config.xingming.label}}</th>
        <th align="" width="">{{config.shenfenzhenghao.label}}</th>
        <th align="" width="">{{config.lianxidianhua.label}}</th>
        <th align="" width="">{{config.xiangxizhuzhi.label}}</th>
        <th align="center" width="8%">操作</th>
    </tr>
{% endblock %}
{% block tableList %}
    {% for Entity in lists %}
        <tr>
            <td align='' width=''>
                <span class="checkall"><input lay-skin="primary" type="checkbox" name="ids[]" value="{{ Entity.id }}"/></span>
            </td>
            <td align='' width='' id='xingming_{{ Entity.id }}'>
                {{ listItem.text('xingming',Entity.xingming,Entity.id) }}
            </td>
            <td align='' width='' id='shenfenzhenghao_{{ Entity.id }}'>
                {{ listItem.text('shenfenzhenghao',Entity.shenfenzhenghao,Entity.id) }}
            </td>
            <td align='' width='' id='lianxidianhua_{{ Entity.id }}'>
                {{ listItem.text('lianxidianhua',Entity.lianxidianhua,Entity.id) }}
            </td>
            <td align='' width='' id='xiangxizhuzhi_{{ Entity.id }}'>
                {{ listItem.text('xiangxizhuzhi',Entity.xiangxizhuzhi,Entity.id) }}
            </td>
            <td align='' width=''>
                <div class="btn-group dropleft">
                    <button type="button" class="btn btn-primary btn-sm" data-toggle="dropdown">管理</button>
                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle dropdown-toggle-split" data-toggle="dropdown">
                        <span class="sr-only">Toggle Dropdown</span>
                    </button>
                    <div class="dropdown-menu">
                        <a class="dropdown-item" href="{{ path("SarsUserPreEdit",{'id':Entity.id,"isMy":isMy}) }}">编辑修改</a>
                        <a class="dropdown-item" href="{{ path("SarsUserLogLists",{'id':Entity.id,"isMy":isMy}) }}">随访记录</a>
{#                        <a class="dropdown-item" href="{{ path("SarsUserLogPreAdd",{'id':Entity.id,"isMy":isMy}) }}">随访记录+</a>#}
                        <a class="dropdown-item" href="{{ path("SarsUserTreatLogLists",{'id':Entity.id,"isMy":isMy}) }}">就诊记录</a>
{#                        <div class="dropdown-divider"></div>#}
                        <a class="dropdown-item" target="_blank" href="{{ path("SarsUserInfo",{'id':Entity.id,"isMy":isMy}) }}">综合报告</a>
                    </div>
                </div>
            </td>
        </tr>
    {% endfor %}
{% endblock %}
{% block script %}
    <script>
        Page = createVM("#selector", {
            start:"{{app.request.get("cond")['start'] is defined and app.request.get("cond")['start'] != "" ?  app.request.get("cond")['start'] : "" }}"
            ,end:"{{app.request.get("cond")['end'] is defined and app.request.get("cond")['end'] != "" ?  app.request.get("cond")['end'] : "" }}"

            ,backStart:"{{app.request.get("cond")['backStart'] is defined and app.request.get("cond")['backStart'] != "" ?  app.request.get("cond")['backStart'] : "" }}"
            ,backend:"{{app.request.get("cond")['backend'] is defined and app.request.get("cond")['backend'] != "" ?  app.request.get("cond")['backend'] : "" }}"
        },{
            "query":function () {
                __doPostBack('lbtnSearch', '')
            }
        })
        function excelOut() {
            $("#excel").val(1);
            __doPostBack('lbtnSearch', '')
            setTimeout(function () {
                $("#excel").val(0);
            },1000)
            return false;
        }
    </script>
{% endblock %}

